import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

BoxDecoration Linear(
    {required List<Color>? colors, Alignment? begin, Alignment? end}) {
  return BoxDecoration(
      gradient: LinearGradient(
          //渐变位置
          begin: begin ?? Alignment.topLeft,
          end: end ?? Alignment.bottomLeft,
          stops: [0, 1.0], //[渐变起始点, 渐变结束点]
          //渐变颜色[始点颜色, 结束颜色]
          colors: colors!),
      borderRadius: BorderRadius.circular(4.w));
}

BoxDecoration Radial(
    {required List<Color>? colors,
    required double? radius,
    Alignment? center}) {
  return BoxDecoration(
      gradient: RadialGradient(
          //渐变位置
          center: center ?? Alignment.center,
          radius: radius!,
          stops: [0, 1.0], //[渐变起始点, 渐变结束点]
          //渐变颜色[始点颜色, 结束颜色]
          colors: colors!));
}

BoxDecoration Sweep(
    {required List<Color>? colors, Alignment? center, double? startAngle}) {
  return BoxDecoration(
      gradient: SweepGradient(
          //渐变位置
          center: Alignment.topLeft,
          startAngle: startAngle!,
          stops: [0, 1.0], //[渐变起始点, 渐变结束点]
          //渐变颜色[始点颜色, 结束颜色]
          colors: colors!));
}
